<?php
/**
 * 描述
 * Created by Paco
 * Date: 2018/10/6 Time: 16:25
 */

namespace App\Repositories\Geo;


use App\Models\Geo\City;
use App\Repositories\Repository;


class CityRepository extends Repository
{

    public function citys($gbcode)
    {
        if ($gbcode) {
            $city = City::query()->where('province_gbcode', $gbcode)
                ->select('city_gbcode','city_name')
                ->get();
        } else {
            $city = City::query()->groupBy('province_gbcode')
                ->select('province_gbcode','province_name')
                ->get();
        }
        return $this->respondWith($city);
    }
}